<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <title>机蜂云盘后台管理系统</title>
  <link rel="stylesheet" href="/layui/css/layui.css">
  <style>
    #content{
      height: 100%;
      width: 100%;
      border: none;
    }
  </style>
</head>
<body>
<div class="layui-layout layui-layout-admin">
  <div class="layui-header">
    <div class="layui-logo layui-hide-xs layui-bg-black">机蜂云后台管理</div>
    <!-- 头部区域（可配合layui 已有的水平导航） -->
    <ul class="layui-nav layui-layout-right">
      <li class="layui-nav-item layui-hide layui-show-md-inline-block">
        <a href="javascript:;" id="username"></a>
        <dl class="layui-nav-child">
          <dd><a href="javascript:;" onclick="userinfo()">个人信息</a></dd>
          <dd><a href="javascript:;" onclick="openPassword()">修改密码</a></dd>
          <dd><a href="javascript:;" onclick="logout()">退出系统</a></dd>
        </dl>
      </li>
    </ul>
  </div>

  <div class="layui-side layui-bg-black">
    <div class="layui-side-scroll">
      <!-- 左侧导航区域（可配合layui已有的垂直导航） -->
      <ul class="layui-nav layui-nav-tree" lay-filter="homeNav">
        <li class="layui-nav-item">
          <a href="userinfo" target="content">
            <i class="layui-icon layui-icon-friends"></i>&nbsp;用户管理
          </a>
        </li>
        <li class="layui-nav-item">
          <a href="power" target="content" id="vip"><i class="layui-icon layui-icon-user"></i>&nbsp;权限管理</a>
        </li>
        <li class="layui-nav-item">
          <a href="javascript:;" id="file"><i class="layui-icon layui-icon-picture"></i>&nbsp;文件管理</a>
        </li>
      </ul>
    </div>
  </div>

  <div class="layui-body">
    <div style="padding: 15px;height: 100%">
      <iframe name="content" id="content" src="/welcome"></iframe>
    </div>
  </div>
</div>
<script src="/layui/layui.js"></script>
<script src="/layui/jquery.min.js"></script>
<script src="/util/cookies.js"></script>
<script>

  $("#username").text(loginInfo.nickname);

  function logout() {
    layer.confirm('确定退出系统吗?', {icon: 3}, function (index) {
      location.replace("/logout")
      layer.close(index);
    })
  }

  function userinfo() {
    layer.open({
      type: 2,
      content: "/userinfo/edit?id=" + loginInfo.id,
      maxmin: true,
      area: ['500px', '300px']
    })
  }

  function openPassword() {
    layer.open({
      type: 2,
      content: "/userinfo/password",
      maxmin: true,
      area: ['500px', '350px']
    })
  }
</script>
</body>
</html>
